  /**
    * 封装 axios 请求模块
    */
    import axios from "axios"
    import store from "@/store"
    // import { config } from "vue/types/umd"
   
   const request = axios.create({
    baseURL:'http://toutiao.itheima.net'
    //  baseURL: "http://geek.itheima.net" // 基础路径
   })

  request.interceptors.request.use(function(confing){ 
      if(store.state.user){
        confing.headers.Authorization = `Bearer ${store.state.user.token}`
      }
      return confing
  })


   
   export default request

 